	<include file='Common:header' />

		<!-- /section:basics/navbar.layout -->
		<div class="main-container" id="main-container">

			<!-- #section:basics/sidebar -->

	<include file='Common:left' />


			<!-- /section:basics/sidebar -->
			<div class="main-content">
				<div class="main-content-inner">
					<div class="page-content">

                        
                        
                        <!--主题-->
						<div class="page-header">
							<h1>
								您当前操作
								<small>
									<i class="ace-icon fa fa-angle-double-right"></i>
									添加文章
								</small>
							</h1>
						</div>

<script>
$(document).ready(function(){
  $("#source_1").click(function(){
	var source_1=$('#source_1').val();
	$("#news_source").val(source_1);
	return false;
  });
  
  $("#source_2").click(function(){
	var source_2=$('#source_2').val();
	$("#news_source").val(source_2);
	return false;
  });
    
  $("#source_3").click(function(){
	var source_3=$('#source_3').val();
	$("#news_source").val(source_3);
	return false;
  });
  
  $("#source_4").click(function(){
	var source_4=$('#source_4').val();
	$("#news_source").val(source_4);
	return false;
  });
  
  $("#source_5").click(function(){
	var source_5=$('#source_5').val();
	$("#news_source").val(source_5);
	return false;
  });
  
  $("#source_6").click(function(){
	var source_6=$('#source_6').val();
	$("#news_source").val(source_6);
	return false;
  });
  
  $("#source_7").click(function(){
	var source_7=$('#source_7').val();
	$("#news_source").val(source_7);
	return false;
  });
  
  $("#source_8").click(function(){
	var source_8=$('#source_8').val();
	$("#news_source").val(source_8);
	return false;
  });
  
  $("#source_9").click(function(){
	var source_9=$('#source_9').val();
	$("#news_source").val(source_9);
	return false;
  });
  
  $("#source_10").click(function(){
	var source_10=$('#source_10').val();
	$("#news_source").val(source_10);
	return false;
  });
});

$(function(){
	$('#address').hide();//默认隐藏
	$('#type2').click(function(){
		$('#address').show();
	});	
	$('#type1,#type3,#type4,#type5').click(function(){
		$('#address').hide();
	});	
});

$(function(){
	$('#columnadd').ajaxForm({
		beforeSubmit: checkForm, // 此方法主要是提交前执行的方法，根据需要设置
		success: complete, // 这是提交后的方法
		dataType: 'json'
	});
	
	function checkForm(){
		if( '' == $.trim($('#column_name').val())){
			$('#resone').attr("class", "middle highmsg");//ID为resone 重新class赋值
			$('#resone').html('栏目标题不能为空').show();//id为resone 赋值html值
			$('#column_name').focus(); 
			return false;
		}
 }
	function complete(data){
		if(data.status==1){
			layer.alert(data.info, {icon: 6}, function(index){
 			layer.close(index);
			window.location.href=data.url;
			});
		}else{
			alert(data.info);
			return false;	
		}
	}
 
});
</script>
						<div class="row">
							<div class="col-xs-12">
								<form class="form-horizontal" name="columnadd" id="columnadd" method="post" action="{:U('runnews_columnadd')}">
                                <input type="hidden" name="column_leftid" value="{$column_leftid}" />
														
                                	<div class="form-group">
										<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 文章所属主栏目： </label>
										<div class="col-sm-9">
                                        <select name="news_columnid"  class="col-sm-3 " >
											<option value="">请选择所属栏目</option>
												<foreach name="column" item="vo">
											<option value="{$vo.c_id}" <if condition="$vo.column_type eq 1">
												disabled class="bgccc"
											<else/>
												class="bgc"
											</if>
												>{$vo.lefthtml}{$vo.column_name} 
											<if condition="$vo.column_type eq 1">
												(频道页)
											</if>
											</option>
                                        </foreach>
                                        </select>
                                        </div>
									</div>
									<div class="space-4"></div>
                                    
                                	<div class="form-group">
										<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 栏目名称：  </label>
										<div class="col-sm-9">
											<input type="text" name="column_name" id="column_name"  placeholder="必填：文章标题"  class="col-xs-10 col-sm-6"/>
											 <input type="text" name="column_name" id="column_name"  placeholder="简短标题，建议6~12字数"  class="col-xs-10 col-sm-4" style="margin-left:10px;" />
                                            <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle" id="resone"></span>
											</span>
										</div>
									</div>
                                    <div class="space-4"></div>

									<div class="form-group">
										<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 文章属性：  </label>
												<div class="checkbox">
                                                <foreach name='diyflag' item='diyflag'>
													<label>
														<input class="ace ace-checkbox-2" name="news_flag[]" type="checkbox" id="news_flag[]" value="{$diyflag.diyflag_value}" />
														<span class="lbl"> {$diyflag.diyflag_name}</span>
													</label>
                                                </foreach>
												</div>
									</div>
                                    <div class="space-4"></div>
									
									<div class="form-group">
										<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 文章关键字：  </label>
										<div class="col-sm-9">
											<input type="text" name="column_enname" id="column_enname" placeholder="输入文章关键字，以英文,逗号隔开" class="col-xs-10 col-sm-6" />
										</div>
									</div>
                                    <div class="space-4"></div>
									
									<div class="form-group">
										<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 文章来源：  </label>
										<div class="col-sm-9">
											<input type="text" name="news_source" id="news_source" value="龙岩网" class="col-xs-10 col-sm-2" />
											<label class="input_last">
											常用：<button class="btn btn-minier btn-yellow" id="source_1" value="龙岩网">龙岩网</button>
												 <button class="btn btn-minier btn-yellow" id="source_2" value="海峡导报">海峡导报</button>
												 <button class="btn btn-minier btn-yellow" id="source_3" value="闽西新闻网">闽西新闻网</button>
												 <button class="btn btn-minier btn-yellow" id="source_4" value="海峡都市报">海峡都市报</button>
												 <button class="btn btn-minier btn-yellow" id="source_5" value="凤凰房产">凤凰房产</button>
												 <button class="btn btn-minier btn-yellow" id="source_6" value="新华网">新华网</button>
												 <button class="btn btn-minier btn-yellow" id="source_7" value="人民网">人民网</button>
												 <button class="btn btn-minier btn-yellow" id="source_8" value="南方都市报">南方都市报</button>
												 <button class="btn btn-minier btn-yellow" id="source_9" value="东南网">东南网</button>
												 <button class="btn btn-minier btn-yellow" id="source_10" value="腾讯网">腾讯网</button>
											</label>
										</div>
									</div>
                                    <div class="space-4"></div>
									
									<div class="form-group" id="address">
										<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 跳转地址：  </label>
										<div class="col-sm-9">
											<input type="text" name="column_address" id="column_address" placeholder="跳转地址" class="col-xs-10 col-sm-7" />
                                            <span class="help-inline col-xs-12 col-sm-5">
												<span class="middle">正确格式：http:// 开头</span>
											</span>
										</div>
									</div>
                                    <div class="space-4"></div>
                                    
									<div class="form-group">
										<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 是否审核： </label>
										<div class="col-sm-9" style="padding-top:5px;">
                                            <input name="column_open" id="column_open" value="1" class="ace ace-switch ace-switch-4 btn-flat" type="checkbox" />
											<span class="lbl">&nbsp;&nbsp;默认关闭</span>
										</div>
									</div>
                                    <div class="space-4"></div>

									<div class="form-group">
										<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 文章简介： </label>
										<div class="col-sm-9">
											<input type="text" name="column_order" id="column_order" value="50" class="col-xs-10 col-sm-10"  maxlength="50" />
											<label class="input_last">已限制在50个字以内</label>
										</div>
									</div>
                                    <div class="space-4"></div>

									<div class="form-group">
										<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 文章主内容 </label>
										<div class="col-sm-9">
											<script src="__PUBLIC__/ueditor/ueditor.config.js" type="text/javascript"></script>
                                            <script src="__PUBLIC__/ueditor/ueditor.all.js" type="text/javascript"></script>
											<textarea name="column_content" rows="100%" style="width:100%" id="myEditor"></textarea>  
											<script type="text/javascript"> 
                                                var editor = new UE.ui.Editor(); 
                                                editor.render("myEditor"); 
                                            </script>
										</div>
									</div>
                                    <div class="space-4"></div>
                                    
									<div class="clearfix form-actions">
										<div class="col-md-offset-3 col-md-9">
											<button class="btn btn-info" type="submit">
												<i class="ace-icon fa fa-check bigger-110"></i>
												保存
											</button>

											&nbsp; &nbsp; &nbsp;
											<button class="btn" type="reset">
												<i class="ace-icon fa fa-undo bigger-110"></i>
												重置
											</button>
										</div>
									</div>
								</form>
                        	</div>
                        </div>
									<div class="hr hr-24"></div>

<include file='Common:header_nav' />

					</div><!-- /.page-content -->
				</div>
			</div><!-- /.main-content -->

	<include file='Common:footer' />

		</div><!-- /.main-container -->

    		<!--下拉样式以及JS-->
		<link rel="stylesheet" href="__PUBLIC__/assets/css/chosen.css" />
		<script src="__PUBLIC__/assets/js/chosen.jquery.js"></script>
		<script type="text/javascript">
			jQuery(function($) {
				if(!ace.vars['touch']) {
					$('.chosen-select').chosen({allow_single_deselect:true}); 
					$(window)
					.off('resize.chosen')
					.on('resize.chosen', function() {
						$('.chosen-select').each(function() {
							 var $this = $(this);
							 $this.next().css({'width': $this.parent().width()});
						})
					}).trigger('resize.chosen');
			
				}
			});
		</script>
	</body>
</html>
